﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Text;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html.simpleparser;

namespace TotalSport
{
    public partial class ShowQuotes : System.Web.UI.Page
    {
        PagedDataSource source;
        //int pos;
        protected void Page_Load(object sender, EventArgs e)
        {
            BAL.conn.connectionString = ConfigurationManager.ConnectionStrings["TotalSport"].ConnectionString;      
            if (!IsPostBack)
            {
                if (Request.QueryString["refno"] != null)
                {
                    int referenceno = Convert.ToInt32(Request.QueryString["refno"]);
                    ViewState["Refno"] = referenceno;
                    lblrefeno.Text = Convert.ToString(referenceno);
                    string[] detaills = BAL.Customers.getpernldetail(referenceno);
                    lblName.Text = detaills[2] + detaills[3];
                    lblcompanyname.Text = detaills[6];
                    getproduct();
                }
                ViewState["vs"] = 0;
            }
    
        }
        public void getproduct()
        {
            int refereno = Convert.ToInt32(ViewState["Refno"]);
            DataSet ds = BAL.Customers.getproductdetails(refereno);
            source = new PagedDataSource();
            source.DataSource = ds.Tables[0].DefaultView; 
            rptshowquote.DataSource = source;
            rptshowquote.DataBind();
        }      
    }
}